<?php
/**
 * Template Name: About - Meet Members
 * Description: The team page for About
 *
 * @package ManterRealty
 * 
 */

get_header(); ?>
		
        <div class="kc_wrap kc_section">
        	<?php if ( have_posts() ) : ?>
            	<?php while ( have_posts() ) : the_post(); ?>
					<div class="cols cols_2cols about_cols about_cols_2cols clearfix">
                   
                    	<div class="col col_1">
                        	<div class="col_pad">
                            
                            	<div class="sec_nav_wrap">
									<div class="sec_nav_pad">
										<ul class="sec_nav">
										<?php
											// declare custom fields before entering deeper loops
											$vals = get_post_custom_values('member_image',$page->ID);
											$meetImage = wp_get_attachment_image_src($vals[0], 'full');
											
											$vals = get_post_custom_values('member_name',$page->ID);
											$meetName = $vals[0];
											
											$vals = get_post_custom_values('info_col_1',$page->ID);
											$infoCol1 = $vals[0];
											
											$vals = get_post_custom_values('info_col_2',$page->ID);
											$infoCol2 = $vals[0];
									
											
											$parent = 38; // About
											$args=array(
											  'child_of' => $parent
											);
											$pages1 = get_pages($args);  
											if ($pages1) {
											  $pageids = array();
											  foreach ($pages1 as $page) {
												$pageids[]= $page->ID;
											  }
											
											  $args=array(
												'title_li' => '',
												'include' =>  $parent . ',' . implode(",", $pageids)
											  );
											  wp_list_pages($args);
											}
										?> 
										</ul>
									</div>
                                </div>
                                
                                <div class="callout_wrap">
                                	<div class="callout_pad">
                                    	
                                    </div>
                                </div>
                                
                            </div>
                        </div>
                    	
                        <div class="col col_2">
							<div class="meet_wrap">
								<div class="meet_label">
									<?php echo($meetName); ?>
								</div>
								<div class="meet_image">
									<?php echo('<img src="'.$meetImage[0].'" />'); ?>
								</div>
								<div class="meet_content">
									<?php the_content(); ?>
								</div>
								<div class="meet_additional">
									<?php if($infoCol1) { ?>
									<div class="addl_col">
										<div class="col_pad">
											<?php echo($infoCol1); ?>
										</div>
									</div>
									<?php } ?>
									<?php if($infoCol2) { ?>
									<div class="addl_col">
										<div class="col_pad">
											<?php echo($infoCol2); ?>
										</div>
									</div>
									<?php } ?>
									<div class="clear"></div>
								</div>
							</div>
							<?php 
                            	
                            ?>
                        </div>
						
                    </div>
				<?php endwhile; ?>
             <?php endif; ?>
        </div>

<?php get_footer(); ?>